package com.hm.base.service;

import java.util.List;

import com.hm.base.su.BaseConfig;
import com.hm.base.vo.LoginSubscriberVo;
import com.hm.base.vo.MenuVo;
import com.hm.base.vo.OrganizationVo;
import com.hm.base.vo.RoleMenuVo;
import com.hm.base.vo.RoleVo;

/**
 * @author shishun.wang
 * @date 下午4:57:36 2017年6月2日
 * @version 1.0
 * @describe
 */
public interface AuthorizationService {

	public String HTTP_INVOKER_EXPORT_CONTEXT = "/HttpInvokerEndpoing/base/AuthorizationService/" + BaseConfig.HttpInvokerEndpoing.VERSION;

	/**
	 * 登陆
	 * @param username
	 * @param password
	 * @return
	 */
	public LoginSubscriberVo login(String username, String password);

	/**
	 * 加载用户角色
	 * @param subscriberId
	 * @return
	 */
	public List<RoleVo> loadUserRoles(Long subscriberId);

	/**
	 * 加载用户菜单
	 * @param subscriberId
	 * @return
	 */
	public List<MenuVo> loadUserMenus(Long subscriberId);

	/**
	 * 退出
	 * @param userid
	 * @param username
	 */
	public void logout(Long userid, String username);

	/**
	 * 获取用户token
	 * @param subscriberId
	 * @return
	 */
	public LoginSubscriberVo loadLoginToken(Long subscriberId);

	/**
	 * 获取用户组织机构信息
	 * @param subscriberId
	 * @return
	 */
	public List<OrganizationVo> loadUserOrganizations(Long subscriberId);

	public List<RoleVo> loadUserOrganizationRoles(Long subscriberId);

	public List<MenuVo> loadUserOrganizationMenus(Long subscriberId);

	public void settingUserOrganizations(Long subscriberId, List<Long> organizations);

	public void settingUserOrganizationRoles(Long organizationId, List<Long> roles);

	public void settingUserRoles(Long subscriberId, List<Long> roles);

	public void settingRoleMenus(Long roleId, List<Long> menus);

	public List<RoleMenuVo> loadRoleMenus(Long roleId);

	/**
	 * 远程客户端数据权限code校验
	 * @param authCode
	 * @param roles
	 * @return
	 */
	public boolean remoteClienAuthCodeCheck(String authCode, List<Long> roles);

	/**
	 * 刷新系统角色数据权限
	 * @return
	 */
	public boolean refreshSystemRoleDataAuth();
	
}
